﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ESF.MUP.BasePlatform.Domain.Model;
using ESF.MUP.BasePlatform.DbRepositories;
using System.Data.Entity;


namespace ESF.MUP.BasePlatform.DbRepository.MSSQL.Model
{
    public class ComponentsModelBuilder
    {
        public static void ConfigureDatabase(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Component>().ToTable("Components");
            //modelBuilder.Entity<Application>().Property(a => a.Id).HasColumnName("Id");
            //modelBuilder.Entity<Application>().Property(a => a.Name).HasColumnName("Name");
            //modelBuilder.Entity<Application>().Property(a => a.Description).HasColumnName("Description");

            modelBuilder.Entity<Component>().HasKey(a => a.Id);

            modelBuilder.Entity<Component>().HasMany(c => c.SubComponents).WithOptional();
            

        }
    }

}

